// *** LICENSE HEADER ***
// Filename: ./mainmenu.h
// This file is part of Nodewarz 0.1
// Nodewarz is a 3d OpenGL strategy game
// Copyright (C) 2007 CZestmyr
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// *** END LICENSE HEADER ***
#ifndef NODEWARS_MAIN_MENU_H
#define NODEWARS_MAIN_MENU_H

#include <SDL.h>
#include <SDL_image.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "Ieventhandler.h"
#include "engine.h"
#include "fonts.h"
#include "imagefunctions.h"
#include <cmath>

class engine;

//Class that handles the creation and displaying of the main menu
class mainMenu: public IeventHandler {
    public:
        mainMenu(engine* newParent);

        //Update function
        void Update(Uint32 dt);
        //Load the menu textures
        void LoadTextures();
        //Unload the textures
        void UnloadTextures();
        //Draw the main menu
        void Draw();

        //IeventHandler functions
        void MouseClickEvent(int xCoordinate, int yCoordinate, bool right = false);
        void MouseReleaseEvent(int xCoordinate, int yCoordinate, bool right = false);
        void MouseMoveEvent(int newX, int newY, int relX, int relY);
        void KeyPressEvent(SDLKey key, char c);
        void KeyReleaseEvent(SDLKey key);
    private:
        engine* parent;
        Uint32 timestamp;

        //The menu textures
        GLuint titleTexture;
        GLuint button1;
        GLuint button2;
        GLuint selectTexture;

        //Current menu selection
        int selection;
};

#endif
